#include "dat.h"
using namespace std;

// 将当前动作写入机器人中
bool assainTaskForRobot(Robot &cur_robot)
{
    filterAvailableAction(cur_robot.loc);
    if(available_action.empty())
        return false;
    vector<pair<int, int>> v;
    int s = available_action.size();
    for (int i = 0; i < s; i++)
    {
        v.push_back({available_action[i]->gain, i});
    }
    sort(v.begin(), v.end());
    cur_robot.cur_action = available_action[v[s - 1].second];
    return true;
}